<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //数组扁平化操作 flat（默认为1），infinity 全部扁平
        let arr = [1,2,3,[1,2,3]]
        console.log(arr.flat())
        let arr1 = [1,3,4,[1,3,[3,1]]]
        console.log(arr1.flat())
        let arr2 = [1,34,5,[2,3,5,[3,5,3]]]
        console.log(arr2.flat(Infinity))
    </script>
</body>
</html>